<%@page import="helpers.UrlHelper"%>
<%@page import="entities.AuthorQuestion"%>
<%@page import="java.util.Map"%>
<%@page import="entities.Author"%>
<%@page import="java.util.List"%>
<%@page import="helpers.PaginatorHelper"%>
<%
List<Author> authors = (List<Author>) request.getAttribute("authors");
Map<String, AuthorQuestion> authorQuestions = (Map<String, AuthorQuestion>) request.getAttribute("authorQuestions");
AuthorQuestion aq = null;

//Set content for seo
String title = "Lastest author have updated";
String description = "The authors list has just been updated in Medical Question";
String url = UrlHelper.getServerUrl(request) + "/lastest-user";
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="/layouts/header.jsp">
	<jsp:param name="title" value="<%=title %>" />
    <jsp:param name="description" value="<%=description %>" />
    <jsp:param name="ogtitle" value="<%=title %>" />
    <jsp:param name="ogurl" value="<%=url %>" />
    <jsp:param name="ogdescription" value="<%=description%>" />
</jsp:include>

	<script type="text/javascript" src="/js/users.js"></script>
		<div class="mainContent clearafter">
			<div class="leftMainContent">
				<!-- TAB -->
				<ul id="tab" class="clearafter">
					<li><a href="/users">All Users</a></li>
					<li class="active"><a href="/lastest-user">Lastest User</a></li>
				</ul>
				<!-- END TAB -->
				
				<!-- Content Tab -->
				<div class="content">
					<div class="content_in">
						<ul class="user_listing">
							<% 
							for (Author author: authors) {
								aq = authorQuestions.get(author.getId());
							%>
							<li class="user_item">
								<img class="agent_photo left" width="100" height="100" src="<%=author.getAvatar() %>" name="user_photo">
								<h3 class="right">
									<span class="left"><a href="/a/<%=author.getAlias()%>-<%=author.getId()%>"><%=author.getName() %></a></span>
									<span class="total"><a href="/a/<%=author.getAlias()%>-<%=author.getId()%>#questions">Questions Asked  <b><%=aq != null ? aq.getqIds().size() : "0" %></b></a></span>
									<span class="total_point"><a href="/a/<%=author.getAlias()%>-<%=author.getId()%>#answers">Answers Provided <b><%=aq != null ? aq.getaIds().size() : "0" %></b></a></span>
								</h3>
								<p class="links right">                                               
									<span class="right profile">
										<a href="/a/<%=author.getAlias()%>-<%=author.getId()%>">View Profile »</a>
									</span>
								</p>
							</li>
							<% } %>
						</ul>
						
					</div>
				</div>
				<!-- End Content tab -->
			</div>
			<jsp:include page="/elements/right.jsp" />
		</div>
<jsp:include page="/layouts/footer.jsp" />